package nl.vu.few.ibivu.biomodels.client;

import nl.vu.few.ibivu.biomodels.shared.Model;
import nl.vu.few.ibivu.biomodels.shared.NotFindException;
import nl.vu.few.ibivu.biomodels.shared.NotLoggedInException;
import nl.vu.few.ibivu.biomodels.shared.OperationNotPermittedException;
import nl.vu.few.ibivu.biomodels.shared.PetrifierModelExecution;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("model")
public interface ModelService extends RemoteService, PagerService<Model> {
	Integer count() throws NotLoggedInException;
	Model fetch(Long modelId) throws NotFindException;
	GwtRpcResultList<Model> fetch(Integer startRow, Integer endRow, String order) throws NotLoggedInException;
	Model save(Model model) throws NotLoggedInException, OperationNotPermittedException;
	void remove(Long modelId) throws NotLoggedInException, NotFindException, OperationNotPermittedException;
	void execute(Long modelId) throws NotLoggedInException, NotFindException, OperationNotPermittedException;
	PetrifierModelExecution fetchExecution(Long modelId) throws NotFindException, NotLoggedInException, OperationNotPermittedException;
	boolean isExecuted(Long modelId);
}
